#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
using ll=long long;
int main() {

	int n;
	cin>>n;
	vector<int> vecArr(3*n);
	ll nRet=0;
	for(int i=0;i<3*n;++i){
		cin>>vecArr[i];
	}
	sort(vecArr.begin(),vecArr.end(),[](int p1,int p2){
		return p1>p2;
	});

	for(int i=1;i<3*n-n;i+=2){
		nRet+=vecArr[i];
	}
	cout<<nRet;
	
	return 0;
}
